<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作者信息</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="css/authormain.css">
</head>


<body>
	<!--导航栏  -->
	<%@ include file="novelhead.jsp" %>
    <div class="layui-container">
        <div class="layui-row">
            <!--作者信息-->
            <div class="layui-card">
                <div class="layui-card-header" style="border-bottom:solid black 1px !important;"><span style="font-size:24px;font-weight: 1000">作者</span></div>
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-md2">
                            <img src="../upload/${author.photourl}" class="authorimg">
                        </div>
                        <div class="layui-col-md4">
                            <div class="layui-card author">
                                <div class="layui-card-header"><span style="font-size:20px">${author.nickname}</span></div>
                                <div class="layui-card-body">
                                    <span class="abstract">${author.signature}</span>
                                </div>
                                <div class="layui-card-foot">
                                    <table style="margin:auto;width: 100%">
                                        <tr>
                                            <td>作品数</td>
                                            <td>创作天数</td>
                                            <td>创作字数</td>
                                        </tr>
                                        <tr>
                                            <td><strong>${author.novelcount}</strong></td>
                                            <td><strong>1315</strong></td>
                                            <td><strong>536万</strong></td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <c:forEach items="${authornovel}" var="obj" begin="0" end="2" step="1" >
	                        <div class="layui-col-md2" style="text-align: center">
	                            <a href="novel.action?novelid=${obj.novelid}">
		                            <img src="../upload/${obj.photourl}" alt="${obj.novelname}">
		                            <br>
		                            <span>${obj.novelname}</span>
		                        </a>
	                        </div>
                        </c:forEach>
                    </div>
                </div>
            </div>
            <!--作者作品-->
            <div class="layui-card">
                <div class="layui-card-header" style="border-bottom:solid black 1px !important;">
                    <span style="font-size:24px;font-weight: 1000">全部作品</span>
                    <c:if test="${loginuser.userid==author.userid}">
                     	<a href="createnovel.jsp" class="layui-btn" style="float:right;margin-right:100px;">+创作新书</a>
                    </c:if>
                    <c:if test="${loginuser.userid!=author.userid&&loginuser.userid!=null}">
                    	<a href="addticketcont.action?userid=${author.userid }&loginuser=${loginuser.userid}" 
	                    	onclick="one()" id="aa" class="layui-btn" style="float:right;margin-right:100px;background:orange">
	                    	+投推荐票
                    	</a>             
                    </c:if>
                    <c:if test="${loginuser.userid!=author.userid&&loginuser.userid==null}">
                    	<a href="login.jsp" 
	                    	class="layui-btn" style="float:right;margin-right:100px;background:orange">
	                    	+投推荐票
                    	</a>             
                    </c:if>
                </div>
                <div class="layui-card-body">
                    <!--第一条信息-->
                    <c:forEach items="${authornovel}" var="obj" >
                    <div class="layui-row" style="border-bottom:solid 1px #BCBCBC;margin-bottom: 10px;">
                        <div class="layui-col-md2">
                            <img src="../upload/${obj.photourl}">
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-card">
                                <div class="layui-card-header">
                                    <a href="novel.action?novelid=${obj.novelid }">
                                    	<p style=" font-family: '楷体';font-size: 18px;font-weight: 600">${obj.novelname}</p>
                                    </a>
                                </div>
                                <div class="layui-card-body">
                                    <table class="noveltable">
                                        <tr>
                                            <td>${obj.nickname}</td>
                                            <td style="border:1px solid #BCBCBC;border-bottom: none;border-top: none;">${obj.typename}</td>
                                            <c:if test="${obj.novelstatus == 1}">
				                           		<td>完本</td>
				                            </c:if>
				                            <c:if test="${obj.novelstatus == 2}">
				                            	<td>连载</td>
				                            </c:if>
				                            <c:if test="${loginuser.userid==obj.userid  }">
					                            <c:if test="${obj.auditstatus=='True' }">
					                        		<td style="color:green">
					                        			审核通过
					                        		</td>
				                        		</c:if>
				                        		<c:if test="${obj.auditstatus =='False' }">
					                        		<td style="color:red">
					                        			审核中
					                        		</td>
				                        		</c:if>
			                        		</c:if>
                                        </tr>
                                    </table>
                                </div>
                                <div class="layui-card-foot">
                                    <p class="abstract" style="margin-left:3%;color:gray">
                                        ${obj.abstrac}
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md4">
                            <div class="layui-row">
                                <table class="tableinfo">
                                    <tr>
                                        <td>1313万</td>
                                        <td>&nbsp;总字数</td>
                                    </tr>
                                    <tr>
                                        <td>1313万</td>
                                        <td>&nbsp;总推荐</td>
                                    </tr>
                                    <tr>
                                        <td>1313656万</td>
                                        <td>&nbsp;总点击</td>
                                    </tr>
                                </table>
                            </div>
                            <div class="layui-row">
                                <c:if test="${loginuser.userid==author.userid}">
                                	<a href="deletenovel.action?novelid=${obj.novelid}&userid=${loginuser.userid}" class="redbtn">删除小说</a>
                                	<a href="editnovel.action?novelid=${obj.novelid}" class="bluebtn" >书籍编辑</a>
                                </c:if>
                                <c:if test="${loginuser.userid!=author.userid}">
                                	<a href="novel.action?novelid=${obj.novelid}" class="redbtn">书籍详情</a>
                                	<c:if test="${loginuser==null}">
                                	<a href="login.jsp" class="bluebtn">加入书架</a>
	                                </c:if>
	                                <c:if test="${loginuser!=null}">
	                                	<a href="addbooksroom.action?novelid=${obj.novelid}&userid=${loginuser.userid}&chapterid=1" class="bluebtn">加入书架</a>
	                                </c:if>
	                                </c:if> 
                            </div>
                        </div>
                    </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>
     <!-- 脚部文件 -->
	<%@ include file="foot.jsp"%>
</body>
<script src="layui/layui.js">
	var errorMsg="${errorMessage}";
	    if(errorMsg!=""){
	        alert(errorMsg);
	    }
	//超链接失效
	int num = 0;
	function one(){
		
		if(num >1){
			document.getElementById("aa").disabled=true;
		}else{
			num = num + 1;
			
		}	
		return num;
	}
</script>

</html>
